<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>网页标题</title>
		<style>
		  *{
			   margin: 0;
				 padding: 0;
				 list-style: none;
			}
      ul li{
			width: 200px;
			height: 100px;
			background: lightblue;
			margin-bottom: 20px;
			}
		</style>
		<script>
		window.onload=function(){
			var aLi=document.getElementsByTagName('li');
			for(i=0;i<aLi.length;i++){
        aLi[i].timer=null;
				aLi[i].onmousemove=function(){
					 startMove(this,400);
				}
				aLi[i].onmouseout=function(){
					 startMove(this,200);
				}
			}
		}
		function startMove(obj,target){
		  clearInterval(obj.timer);
      obj.timer=setInterval(function(){
			   var speed=(target-obj.offsetWidth)/8;
				 speed=speed>0?Math.ceil(speed):Math.floor(speed);
				 if(obj.offsetWidth==target){
				   obj.clearInterval(obj.timer);
				 }else{
				   obj.style.width=obj.offsetWidth+speed+'px';
				 }
			},30)
		}
		</script>
	</head>
	<body>
    <ul>
    	<li></li>
    	<li></li>
    	<li></li>
    </ul>
	</body>
</html>